package com.sky.mapper;

import com.sky.entity.Employee;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface EmployeeMapper {
    //根据用户名查询员工
    @Select("select * from  employee where username = #{username}")
    Employee getByUsername(String username);

    //查询返回员工手机号 对比
    @Select("select * from employee where phone=#{phone}")
    Employee getByPhone(String phone);

    //查询员工身份证 对比
    @Select("select * from employee where id_number=#{idNumber}")
    Employee getByNumber(String idNumber);

    //查询password
    @Select("select * from employee where  password=#{password}")
    Employee getByPassword(String idNumber);
    //添加
    void insert(Employee employee);

    //分页条件查询sql
    List<Employee> findByPage(String name);

    //根据id查询
    @Select("select * from employee where id=#{id}")
    Employee findById(Long id);

    //更新员工信息
    void update(Employee employee);

    //查询id
    @Select("select * from employee where  id=#{id}")
    Employee getById(Long id);

}
